using System.IO;

namespace OracleInternal.SqlAndPlsqlParser
{
	internal class InputStream : StreamReader
	{
		public InputStream(Stream sr)
			: base(sr)
		{
		}

		public InputStream(string fname)
			: base(fname)
		{
		}

		public T ReadObjectData<T>() where T : IStreamable, new()
		{
			T result = new T();
			if (result.ReadFromStream(this) == 0)
			{
				return result;
			}
			return default(T);
		}
	}
}
